package sc.prototype.pfs.test.eventnotify.collector;

import java.util.Arrays;
import java.util.List;

import org.joda.time.DateTime;
import org.springframework.stereotype.Component;

import sc.prototype.pfs.eventnotify.api.NoticeType;
import sc.prototype.pfs.eventnotify.api.UniNotice;
import sc.prototype.pfs.eventnotify.collector.impl.BaseContentCollector;
import sc.prototype.pfs.eventnotify.model.NotifyConfig;
import sc.prototype.pfs.eventnotify.model.NotifyContext;
import sc.prototype.pfs.eventnotify.model.ParamKey;

import com.alibaba.fastjson.JSON;

@Component
public class MockContentCollector1 extends BaseContentCollector {

    @Override
    public String getName() {
        return "测试采集器1";
    }

    @Override
    public UniNotice processCollect(NotifyConfig config, NotifyContext context) {
        UniNotice notice = new UniNotice();
        notice.setNoticeType(NoticeType.InstPayResult.getCode());
        MockContent content = new MockContent();
        content.setGreets(Arrays.asList("Hello Test", "|", "哈罗测试"));
        content.setGmtNotify(new DateTime().toDate());
        notice.setNoticeContent(JSON.toJSONString(content));
        return notice;
    }

    @Override
    public List<ParamKey> getExtParamKeys() {
        return super.getExtParamKeys();
    }

}
